package com.by.sever;

import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
public class Hello {
    /**
     * 请求 /hello  输出hello springboot!
     *
     * @return
     */
    @RequestMapping(value = "/hello")
    public String hello() {
        return "hello springboot!";
    }

    @RequestMapping(value = "/login")
    public String login(String username, String password) {
        System.out.println("username is:" + username);
        System.out.println("password is:" + password);
        return "0";
    }

    @RequestMapping("/regist")
    @ResponseBody
    public String regist(@RequestBody Person person) {
        System.out.println("person id is:" + person.getId());
        System.out.println("person name is:" + person.getName());
        return "success";
    }

    @RequestMapping("/person")
    @ResponseBody
    public Person person() {


        Person person = new Person();
        person.setId("01");
        person.setName("张三丰");
        person.setAge(100);

        return person;
    }


}